using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DataAccessLayer;

public partial class ModifyMedicine : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnAddMedicine_Click(object sender, EventArgs e)
    {
        Common c = new Common();
        string conn = c.fetchConnString();
        Medicine medi = new Medicine(conn);
        medi.MNAME = txtMedName.Text;
        medi.SPL = txtMedDetails.Text;
        int check = medi.mediVerification(txtMedName.Text);
        if (check == 1)
        {
            lblError.Text = "Medicine already exists";
        }
        else
        {
            int check1 = medi.addMedi();
            if (check1 == 0)
                Response.Write("wrong");

            Response.Redirect("AdminProfile.aspx");
        }
    }
}
